#!/usr/bin/env ruby

LKP_SRC = ENV['LKP_SRC'] || File.dirname(File.dirname(File.realpath($PROGRAM_NAME)))

require 'set'
require "#{LKP_SRC}/lib/common"

error_ids = Set.new

while (line = STDIN.gets)
  next unless line.downcase =~ /(error|warning):[^:]/
  line = line.sub(/\/tmp\/lkp\/[0-9a-zA-Z#]{8}\b/, "#")
  error_ids << build_pkg_error_id(line)
end

error_ids.each do |id|
  puts 'eid.' + id + ': 001'
end
